struct VSInput
{
    float3 position    : POSITION;
    float4 color    : COLOR;
    float2 uv        : TEXCOORD0;
};

struct PSInput
{
    float4 position    : SV_POSITION;
	float4 color    : COLOR;
    float2 uv        : TEXCOORD0;
};


Texture2D        g_txDiffuse : register(t0);
Texture2D        g_txDiffuseDynamic : register(t1);
SamplerState    g_sampler : register(s0);
cbuffer cb0 : register(b0)
{
	float4x4 g_mWorldViewProj;
};
Texture1D		g_palette256 : register(t2);

PSInput VS(VSInput input)
{
	PSInput result;

	result.position = mul(float4(input.position, 1.0f), g_mWorldViewProj);
	result.color = input.color;
	result.uv = input.uv;

	return result;
}

float4 PS(PSInput input) : SV_TARGET
{
	float4 Color = g_txDiffuseDynamic.Sample(g_sampler, input.uv) * input.color;
	clip(Color.a - 0.004f);
	return Color;
}
